// 收藏、点赞的成果

import "./index.less";
import {Image, Text, View} from "@tarojs/components";
import {API_PATH} from "../../api/api";
import {GLOBAL_IMAGE} from "../../constant/contant";
import Taro from "@tarojs/taro";

export function MyAch(props) {
    const {achObj} = props;

    // 跳转到成果详情
    const toAchDetail = () => {
        Taro.navigateTo({
            url: `/pages/detail/index?id=${achObj?.proId}`
        })
    }

    return (
        <View className={"myAch"} onClick={toAchDetail}>
            <View className={"myAchImg"}>
                <Image src={achObj?.imagePath ? API_PATH + achObj?.imagePath : GLOBAL_IMAGE.poster}
                       mode={"aspectFit"}/>
                <View className={"myAch_tag"}>
                    <Text>{achObj?.itName}</Text>
                </View>
            </View>
            <View className={"myAch_right"}>
                <View className={"myAch_title"}>
                    <Text>{achObj?.proName}</Text>
                </View>
                <View className={"myAch_talk"}>
                    <View className={"achTalk_ico"}>
                        <Image src={GLOBAL_IMAGE.talk}/>
                    </View>
                    <View className={"achTalk_num"}>
                        <Text>{achObj?.commentTotal || 0}</Text>
                    </View>
                </View>
            </View>
        </View>
    )
}
